来自:陈凯玲 | 责编:乐乐
链接:kailing.pub/article/index/arcid/257.html
正文
### 演示POST请求
POST {{baseUrl}}}get?show_env=1
Accept: application/json
{
"name":"a"
}
### 演示GET请求
GET {{baseUrl}}}/post
Content-Type: application/x-www-form-urlencoded
id=999&value=content
"uat": {
"baseUrl": "http://gateway.xxx.cn/",
"username": "",
"password": ""
},
"dev": {
"baseUrl": "http://localhsot:8888/",
结果断言
### Successful test: check response status is 200
GET https://httpbin.org/status/200
> {%
client.test("Request executed successfully", function() {
client.assert(response.status === 200, "Response status is not 200");
});
%}
POST https://httpbin.org/post
Content-Type: application/json
"user": "admin",
"password": "123456"
> {% client.global.set("auth_token", response.body.json.token); %}
GET https://httpbin.org/headers
Authorization: Bearer {{auth_token}}
PS:欢迎在留言区留下你的观点,一起讨论提高。如果今天的文章让你有新的启发,欢迎转发分享给更多人。
---END---
更文不易,点个“在看”支持一下👇
文章有问题?点此查看未经处理的缓存